keys_down
This function returns a list of all the keys on the keyboard that are currently being held down.
int[] keys_down()
Parameters:
None.
Return value:
An array with the currently held keys, or an empty array if no keys are being held down or if an error occurs.
Remarks:
The difference between keys_down and keys_pressed is that keys_pressed will only return a list of the keys that the user has just pushed down, while keys_down will return a list of the keys that are currently being held down regardless of whether the same keys have been reported as being down in a previous call.
Example:
// Wait for three different keys to be held down at once before closing the program.
void main()
{
show_game_window("Keys Down Test");
int[] key_list;
while(key_list.length()<3)
{
key_list=keys_down();
wait(5);
}
}